$(function () {
    BASE.COMMON.urlLeftNav();
    $(document).scroll(function () {
        BASE.COMMON.scrollEvent(BASE.VIDEO.getData);
    });
});
var  BASE = BASE||{}; //全局公用方法
BASE.VIDEO = (function () {
    var PAGE = 2;
    /*获取推荐的数据*/
    function getData() {
        var $box = $('#middleListContent');
        var categoryId = BASE.getUrlParam('categoryId');
        var parentId = BASE.getUrlParam('parentId');
        var orderByField = BASE.getUrlParam('orderByField');
        $box.find('.loading').show();
        var sendData = {
            pageNum:PAGE,
            pageSize:15,
            categoryId:categoryId||parentId,
            orderByField:orderByField||'sort',
            recommendIs: '',
        };
        BASE.apiGet('/device/videoAlbum/list',sendData,function (res) {
            ++PAGE;
            $box.find('.loading').hide();
            BASE.COMMON.SCROLLFLAG = true;
            if((res.nextPage == 0 && res.pages > 1) || res.pages <= 1){
                BASE.COMMON.SCROLLFLAG = false;
                if(res.pages!=0 && res.total>=8){
                    $box.find('.nomore-data').show();
                }
            }
            $box.find('.content').append(template('middleListContent_tpl',{data:res.list}));
        })
    }
     return {
         getData:getData,
     }
})();



